package org.example.common.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author jzq
 * @date 2022/8/17 15:09
 */
@SuppressWarnings({"all"})
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Result<T> {

    private int status;

    private String message;

    private T data;

    public Result(int status, String message) {
        this.status = status;
        this.message = message;
    }


    @JsonFormat(shape = JsonFormat.Shape.OBJECT)
    public enum ResultStatus {
        SUCCESS(200),
        FAILED(500);
        public int code;

        ResultStatus(int code) {
            this.code = code;
        }
    }

}
